<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    用户名：<input type="text" id="username" autocomplete="off" placeholder="请输入用户名" autofocus>
    <button id="btn">DOM操作</button>


    <script>
        // DOM操作元素核心的2大步：
        // 1、先找到要操作的元素节点
        // 2、后对节点进行操作
        let btnELe = document.getElementById('btn');
        btnELe.addEventListener('click', function () {
            let inputEle = document.getElementById('username');
            inputEle.value = 'ZZC天天打CSGO';
        });
    </script>
</body>

</html>